﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MPBlog.Model;
using NHibernate.Criterion;

namespace MPBlog.DAL
{
    public class BlogSettingDao:BaseDao<BlogSetting>
    {
        public string GetBlogSetting(string key)
        {
            List<ICriterion> criterions = new List<ICriterion>();
            criterions.Add(Restrictions.Eq("BlogKey", key));
            IList<BlogSetting> blogSettings = GetList(criterions,null);

            if (blogSettings.Count > 0)
            {
                 return blogSettings[0].BlogValue;
            }
            return string.Empty;
        }
    }
}
